/**
 * Created by bian on 16-12-9.
 */
import { connect } from 'react-redux'
import LoginPanel from "../../components/both/LoginPanel/LoginPanel.jsx"
import {tryLogin} from "../../actions/admin/admin_login_actions"

const mapDispatchToProps = (dispatch) => {
    return {
        login: (username,password) => {
            dispatch(tryLogin(username,password))
        }
    }
}

const mapStateToProps = (state,ownProps) => {
    const {loginPanel} = state
    return {
        isAccountRight : loginPanel.isAccountRight,
        isPwdRight: loginPanel.isPwdRight
    }
}

const LoginPanelContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(LoginPanel)

exports.LoginPanelContainer = LoginPanelContainer